package com.jt.provider.service;


import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.stereotype.Service;

@Service
public class ResourceService {
    @SentinelResource(value="doGetResource",
            blockHandlerClass = ResourceBlockHandler.class,
            blockHandler = "doHandle")

    public String doGetResource(){
        return "doGetResource";
    }

    @SentinelResource(value="resource",
            blockHandlerClass = ResourceBlockHandler.class,
            blockHandler = "doHandle")
    public String doGetResource(Integer id){
        //....
        return "the data's id is "+id;
    }
}
